//
//  IMmenueButton.m
//  wanzhaoIM
//
//  Created by wanzhao on 15/7/16.
//  Copyright (c) 2015年 liuyuantao. All rights reserved.
//

#import "IMmenueButton.h"

@implementation IMmenueButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIView *line = [[UIView alloc] init];
        line.backgroundColor = RGBCOLOR(212, 212, 212);
        [self addSubview:line];
        self.line = line;
        
        UIView *downLine = [[UIView alloc] init];
        downLine.backgroundColor = RGBCOLOR(38, 151, 253);
        [self addSubview:downLine];
        self.downLine = downLine;
        downLine.hidden = YES;
    }
    return self;
}

- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    if (selected) {
        self.downLine.hidden = NO;
    } else {
        self.downLine.hidden = YES;
    }
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.downLine.frame = CGRectMake(0, self.frame.size.height - 1.5, self.frame.size.width, 1.5);
    self.line.frame = CGRectMake(0, self.frame.size.height - 0.5, self.frame.size.width, 0.5);
}
@end
